<!doctype html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <title>植物列表</title>
    <link th:href="@{/bootstrap/css/bootstrap.css}" rel="stylesheet">
</head>
<body>
<div th:replace="~{header::header}"></div>

<div class="album py-5 bg-light">
    <div class="container">

        <div class="row row-cols-1 row-cols-sm-2 row-cols-md-3 g-3">
            <div th:each="plant:${plantList}" class="col">
                <div class="card shadow-sm">
                    <img class="bd-placeholder-img card-img-top" width="100%" th:src="${plant.getImageUrl()}" height="225" aria-label="Placeholder: Thumbnail" />

                    <div class="card-body">
                        <p class="card-text">[[${plant.getName()}]]</p>
                        <div class="d-flex justify-content-between align-items-center">
                            <div class="btn-group">
                                <a th:href="@{'/plant/'+${plant.getId()}}">
                                <button type="button" class="btn btn-sm btn-outline-secondary" >查看</button>
                                </a>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

        </div>


    </div>
    <nav aria-label="Page navigation example" class="mt-4">
        <ul class="pagination justify-content-center pagination-sm">
            <li th:class="${pageParam.hasPrevious()==true?'page-item':'page-item disabled'}">
                <a class="page-link" th:href="@{'/plant/'+${pageParam.getCurrent()-1}+'/10'}" tabindex="">下一页</a>
            </li>
            <li class="page-item" th:if="${pageParam.hasPrevious()}">
                <a class="page-link" th:href="@{'/plant/'+${pageParam.getCurrent()-1}+'/10'}" th:text="${pageParam.getCurrent()-1}"></a>
            </li>
            <li class="page-item active">
                <a class="page-link" th:href="@{'/plant/'+${pageParam.getCurrent()}+'/10'}" th:text="${pageParam.getCurrent()}"></a>
            </li>
            <li class="page-item" th:if="${pageParam.hasNext()}">
                <a class="page-link" th:href="@{'/plant/'+${pageParam.getCurrent()+1}+'/10'}" th:text="${pageParam.getCurrent()+1}"></a>
            </li>
            <li th:class="${pageParam.hasNext()==true?'page-item':'page-item disabled'}">
                <a class="page-link"  th:href="@{'/plant/'+${pageParam.getCurrent()+1}+'/10'}" >上一页</a>
            </li>
        </ul>
    </nav>
</div>


<script th:src="@{/js/jquery-3.5.1.min.js}"></script>
<script th:src="@{/bootstrap/js/bootstrap.js}"></script>
<script th:src="@{/bootstrap/js/bootstrap.bundle.js}"></script>


<script>

</script>
</body>
</html>
